home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: thinkage.on.ca!atbowler
- From: atbowler@thinkage.on.ca (Alan Bowler)
- Subject: Re: Is this a C BUG??? (A string issue)
- Message-ID: <Dp964J.9tH@thinkage.on.ca>
- Sender: news@thinkage.on.ca
- Organization: Thinkage Ltd.
- References: <4jknpf$9k3@abel.cc.sunysb.edu> <4jmjgfINN8pr@keats.ugrad.cs.ubc.ca> <AD84A72A96681716E4@mcdiala03.it.luc.edu>
- Date: Tue, 2 Apr 1996 20:55:30 GMT
-
- In article <AD84A72A96681716E4@mcdiala03.it.luc.edu> VArase@varase.it.luc.edu (Verne Arase) writes:
- >In article <4jmjgfINN8pr@keats.ugrad.cs.ubc.ca>,
- >c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku) wrote:
- >
- > >When in doubt, process individual characters rather than being clever
- >with
- > >buffers and string manipulation. It can be more efficient and cleaner.
- >
- >Even better for fixed length records is open/read/write/close. You can even
- >use non-delimited records. (Why waste the space of a line delimiter, if
- >you're not going to use character formatted data?)
-
- While there may be a point in omitting the line delimiter, you should
- use fopen/fclose/fread/fwrite. open/read/write/close are system calls
- on many systems (Unix ones), and the overhead of getting in and out of
- the operation system on each call will swamp any inefficiencies you
- were tryiung to avoid with single character manipulations. On other
- systems open/read/write/close may not exist, or may have some other
- very surprising effects.
-